<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <script>

        function empty(){
            var empths = document.getElementById("username");
            empths.setAttribute("value","1");
            //empths.value = "";

            //文本域
            document.getElementById("text").value = "";
        }

        function getV() {
            var empths = document.getElementById("username");
            document.getElementById("text").innerHTML = empths.value;
        }
    </script>
</head>
<body>
    <form action="#" method="post">
        姓名：<input type="text" name="username" id="username" placeholder="请输入姓名"><br/>
        备注：<textarea rows="3" cols="10" id="text" ></textarea>
        <input type="button" value="确定" onclick="empty()">
        <input type="button" value="确定" onclick="getV()">

    </form>
</body>
</html>